package xyz.zdsoft.attendance_manage_module.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.zdsoft.attendance_manage_module.bo.AdminAttendanceInfoBo;
import xyz.zdsoft.attendance_manage_module.bo.AdminPunchRecordBo;
import xyz.zdsoft.attendance_manage_module.service.AdminAttendanceService;
import xyz.zdsoft.attendance_manage_module.service.AdminPunchRecordService;
import xyz.zdsoft.attendance_manage_module.vo.AdminAttendanceInfoVo;
import xyz.zdsoft.attendance_manage_module.vo.AdminPunchRecordVo;
import xyz.zdsoft.common.utils.Result;
import javax.annotation.Resource;

@RestController
@Api(tags = "管理员考勤管理")
public class AdminAttendanceController {
    @Resource
    private AdminAttendanceService adminAttendanceService;
    @Resource
    private AdminPunchRecordService adminPunchRecordService;
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页",required = true),
            @ApiImplicitParam(name = "size",value = "每页数量",required = true)
    })
    @ApiOperation("条件查询考勤记录(分页)")
    @PostMapping("/SelAttendance")
    public Result<AdminAttendanceInfoVo> SelAttendance(Integer currentPage, Integer size, AdminAttendanceInfoBo adminAttendanceInfoBo){
        return Result.ok().message("查询成功").data(adminAttendanceService.TermSelAttendance(currentPage,size,adminAttendanceInfoBo));
    }

    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页",required = true),
            @ApiImplicitParam(name = "size",value = "每页数量",required = true)
    })
    @ApiOperation("条件查询打卡记录(分页)")
    @PostMapping("/SelPunchRecord")
    public Result<AdminPunchRecordVo> SelPunchRecord(Integer currentPage, Integer size, AdminPunchRecordBo adminPunchRecordBo){
        return Result.ok().message("查询成功").data(adminPunchRecordService.SelPunchRecord(currentPage,size,adminPunchRecordBo));
    }
}
